# Pull base image.
FROM ubuntu:14.04

# Install.
RUN \
#163 src
  echo -n 'deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse\ndeb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse\ndeb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse\ndeb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse\ndeb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse\ndeb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse\ndeb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse\ndeb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse\ndeb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse\ndeb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse\n' > /etc/apt/sources.list && \
  apt-get update && \
  apt-get -y upgrade && \
  apt-get install -y build-essential openssh-server openssh-client && \
  apt-get install -y software-properties-common && \
  apt-get update && \
  apt-get -y upgrade && \
  add-apt-repository ppa:fkrull/deadsnakes && \
  apt-get install -y python2.7 python-pip curl git htop man unzip vim wget && \
  pip install virtualenv && pip install Flask && \
  mkdir -p /usr/local/nginx/web && \
  #git clone http://github.com/mitsuhiko/flask.git && cd flask && virtualenv venv --distribute && .venv/bin/activate && python setup.py develop
  apt-get clean && \
  rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
 # mysql config
#add src
ADD src/ /usr/local/nginx/web/
ADD ./start.sh /start.sh
RUN chmod 755 /start.sh
# private expose
EXPOSE 80
# volume for mysql database and wordpress install
CMD ["/bin/bash", "/start.sh"]
